package oop11.door;

/**
 * @author oldliu
 * @since 1.0
 */
//防盗门
public class TheftProofDoor extends Door implements Lock ,Bell{
    public TheftProofDoor(String b) {
        super(b);
    }

    //重写了父类的开和关的方法
    @Override
    public void open() {
        this.unlock();
        super.open();
    }

    @Override
    public void close() {
        super.close();
        this.lock();
    }

    @Override
    public void lock() {
        System.out.println(super.getBrand()+"上锁了，锁芯转动，彻底锁死");
    }

    @Override
    public void unlock() {
        System.out.println(super.getBrand()+"开锁了，门可以打开！");
    }

    @Override
    public void ring() {
        System.out.println(super.getBrand()+"发出了尖锐的嘀嘀嘀声！");
    }
}
